/**
 * @FileName: BaseServiceImpl.java
 * @Package: service.impl
 * @author youshipeng
 * @created 2016/11/1 9:11
 * <p>
 * Copyright 2016 ziroom
 */
package top.swimmer.boot.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import top.swimmer.boot.dao.BaseMapper;
import top.swimmer.boot.model.BaseModel;
import top.swimmer.boot.service.BaseService;

/**
 * <p></p>
 *
 * <PRE>
 * <BR>	修改记录
 * <BR>-----------------------------------------------
 * <BR>	修改日期			修改人			修改内容
 * </PRE>
 *
 * @author youshipeng
 * @since 1.0
 * @version 1.0
 */
public class BaseServiceImpl<MODEL extends BaseModel, MAPPER extends BaseMapper<MODEL>> implements BaseService<MODEL> {

    @Autowired
    protected MAPPER mapper;

    @Override
    public MODEL get(String id) {
        return mapper.get(id);
    }

    @Override
    public MODEL create(MODEL model) {
        mapper.insert(model);
        return model;
    }

    @Override
    public MODEL update(String id, MODEL model) {
        mapper.update(id, model);
        return model;
    }
}